// src/types/order.ts

// 定义订单中的菜品/套餐详情
export interface IOrderDetailItem {
  amount: number;
  dishFlavor: string;
  dishId: number;
  id: number;
  image: string;
  name: string;
  number: number;
  orderId: number;
  setmealId: number;
}

// 定义订单详情对象 (ID查询时返回)
export interface IOrderDetail {
  address: string;
  amount: number;
  cancelReason?: string;
  consignee: string; // 收货人
  estimatedDeliveryTime: string;
  id: number;
  number: string; // 订单号
  orderDetailList: IOrderDetailItem[];
  orderTime: string;
  packAmount: number;
  payMethod: number; // 1微信, 2支付宝
  phone: string;
  rejectionReason?: string;
  remark: string;
  status: number;
  tablewareNumber: number;
  userId: number;
  userName: string;
  // ... 其他可能返回的字段
}

// 定义订单列表中的单个订单对象 (分页查询时返回)
export interface IOrder extends Omit<IOrderDetail, 'orderDetailList'> {
  orderDishes: string; // 分页查询时返回的是拼接好的字符串
}

// 定义订单分页查询的 Query 参数接口
export interface IOrderPageQuery {
  page: number;
  pageSize: number;
  beginTime?: string;
  endTime?: string;
  number?: string;
  phone?: string;
  status?: number;
}

// 定义订单分页查询接口返回的数据结构
export interface IOrderPageResult {
  total: number;
  records: IOrder[];
}

// 定义订单状态统计接口返回的数据结构
export interface IOrderStatistics {
  confirmed: number; // 待派送
  deliveryInProgress: number; // 派送中
  toBeConfirmed: number; // 待接单
}
